/*
package com.kavin.collection.rocketmq;

import io.netty.util.CharsetUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

*/
/**
 * @ClassName Consumer
 * @Description
 * @Author kavin
 * @Date 2022/8/17 18:32
 * @Version 1.0
 *//*

@Slf4j
@Component
@RocketMQMessageListener(topic = "kavin",
        selectorExpression="msg2"	//tags
        ,consumerGroup = "service-consumer")
public class Consumer implements RocketMQListener<MessageExt> {


    int retryTimes = 1 ;

    @Override
    public void onMessage(MessageExt messageExt) {

        String msg = new String(messageExt.getBody(), CharsetUtil.UTF_8);
        SimpleDateFormat sdf  = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        log.info("第{}次消费，消费时间：{}" ,retryTimes,sdf.format(new Date()));
        retryTimes = retryTimes + 1;
        int i = 7 /0;
    }
}
*/
